Skip to content

Conversation

@nkcsgexi
Copy link
Contributor

@nkcsgexi nkcsgexi commented Nov 18, 2025

  • Explanation: When compiling a Swift module in incremental mode, each Swift source file is compiled into an object file and we use linker to link them together. Because the predicate function for checking dynamic feature availability is eagerly synthesized per compilation unit, the linker will complain about duplicated symbols for them. Setting their visibility as private ensures that linker doesn't see them, thus addressing the linker errors. One workaround for this problem is to enable WMO.

  • Scope: This affects Clang custom availability users who build their codebase incrementally

  • Reviewer: @slavapestov

  • Risk: Low

  • Radar: rdar://164971313

  • Testing: Unit test added

  • Original PR: CustomAvailability: synthesized dynamic availability checking function should be private #85549

…n should be private

When compiling a Swift module in incremental mode, each Swift source file is compiled into an object file
and we use linker to link them together. Because the predicate function for checking dynamic feature
availability is eagerly synthesized per compilation unit, the linker will complain about duplicated
symbols for them. Setting their visibility as private ensures that linker doesn't see them, thus addressing
the linker errors.

One workaround for this problem is to enable WMO.

rdar://164971313
@nkcsgexi
Copy link
Contributor Author

@swift-ci please test

@nkcsgexi nkcsgexi marked this pull request as ready for review November 18, 2025 19:33
@nkcsgexi nkcsgexi requested a review from a team as a code owner November 18, 2025 19:33
@nkcsgexi nkcsgexi enabled auto-merge November 18, 2025 22:50
@nkcsgexi
Copy link
Contributor Author

@swift-ci please smoke test Windows

@nkcsgexi nkcsgexi merged commit 51d2974 into swiftlang:release/6.3 Nov 19, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants